# ===========================================================================
#   http://code.google.com/p/bforcer/source/browse/trunk/b4/ax_pcrecpp.m4
# ===========================================================================
#
# SYNOPSIS
#
#   AX_PCRECPP
#
# DESCRIPTION
#
#	Test for pcrecpp from pcre libraries
#
# LICENSE
#
#   Copyright (c) 2009 Alvaro Morais <alvarommorais@gmail.com
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved.

AC_DEFUN([AX_PCRECPP],
[AC_CACHE_CHECK(whether the pcre library is available,
                                           ax_cv_pcrecpp,
        [AC_LANG_PUSH([C++])
                         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <pcrecpp.h>
                                                                                                ]],
                                   [[pcrecpp::RE tmp(""); tmp.FullMatch(""); return 0;]]),
                   ax_cv_pcrecpp=yes, ax_cv_pcrecpp=no)
         AC_LANG_POP([C++])
                ])

if test "$ax_cv_pcrecpp" = yes; then
	AC_CHECK_LIB([pcrecpp],[main])
fi
])
